package logger

import (
	"demo/kongganghelper/config"
	"github.com/sirupsen/logrus"
	"os"
)

func Init() {
	Config := config.GetConfig()
	if Config.Log.Level != "" {
		level, err := logrus.ParseLevel(Config.Log.Level)
		if err != nil {
			logrus.Error(err)
			return
		}
		logrus.SetLevel(level)
	} else {
		logrus.SetLevel(logrus.TraceLevel)
	}
	logrus.SetOutput(os.Stdout)
}
